/**
 * Created by chengming on 18/4/23.
 * version 1.0
 */
"use strict";
const logger = require('../conf/logger');
const request = require('request-promise');


module.exports = async function(type, source, channel, content){

	let options = {
		url: 'http://screen.jin10.com/logSpider',
		method:'POST',
		body:{
			type:type,
			source:source,
			channel:channel,
			content:content
		},
		json:true
	};
	try{

		if("文章" == type && "中国人民银行" == source && "沟通交流" == channel){
            let echo = await request(options);
            logger.debug("上报错误响应:"+JSON.stringify(echo));
		}

	}catch(e){
		logger.error(e);
	}

}